<template>
  <div>
    <el-row v-for="(list, index) in projectInitiationTaskList" :key="index">
      <div class="title">
          <h4>项目任务</h4>
          <el-button type="primary" size="mini" @click="addTask">添加任务</el-button>
      </div>
      <el-row>
          <el-table :data="list" size="mini" style="width: 100%;" header-cell-class-name="table-header-gray" border>
            <el-table-column type="index" align="center" width="50" label="序号"></el-table-column>
            <el-table-column prop="taskName" align="center" label="任务"></el-table-column>
            <el-table-column prop="fileUrl" align="center" label="成果文件"></el-table-column>
            <el-table-column prop="examine" align="center" label="是否审核"></el-table-column>
            <el-table-column prop="executor" align="center" label="执行人" show-overflow-tooltip></el-table-column>
            <el-table-column prop="startTime" align="center" label="预计开始时间"></el-table-column>
            <el-table-column prop="completionTime" align="center" label="预计完成时间"></el-table-column>
            <el-table-column label="操作" align="center" width="140">
                <template slot-scope="scope">
                  <el-button type="text" @click="aaa(scope)">上传</el-button>
                  <el-button type="text" @click="editorTask(scope.row)">编辑</el-button>
                  <el-button type="text">删除</el-button>
                </template>
            </el-table-column>
          </el-table>
      </el-row>
    </el-row>
  </div>
</template>
<script>
import TasksAdd from '../TasksAdd.vue';
export default {
  props: {
    projectInitiationTaskList: {
      type: Array,
      default: () => []
    }
  },
  data () {
    return {};
  },
  mounted () {
    console.log('this.projectInitiationTaskList:', this.projectInitiationTaskList);
  },
  methods: {
    addTask () {

    },
    editorTask (item) {
      console.log('编辑任务', item);
      this.$dialog.show('编辑任务', TasksAdd, {
        area: ['800px', '70vh']
      }, {params: item}).then(res => {
        console.log('打开弹窗', res);
      }).catch(e => {
        console.log('关闭弹窗', e);
      });
    }
  }
};
</script>
<style lang="scss" scoped>
  .title{
    display: flex;align-items: center;justify-content: space-between;
    h4{font-weight: bold;}
  }
</style>
